Now for some strange looking but powerful ideas. You don't have to understand them all just give them a try. Some interesting things can be done by setting a few simple aliases. Some of these aliases take advantage of AWNPipes GUI building feature covered in a different section of these docs.
alias see echo >awnpipe:/xc "defg*nbitmap fn []*nimage*nopen"
Now 'see FILENAME' will display pictures using your datatypes.
alias readtext echo >awnpipe:/xc "defg a cs *ntextfield a minw 200 minh 200 gt 0 bd ro datain []*nopen"
Now 'readtext FILENAME' will display a textfile.
alias toolt type awnpipe:/xi[]
Now 'toolt FILENAME' will display the tooltypes of FILENAME. (do not include .info in FILENAME).
alias text2html copy awnpipe:t2h/f/h/r[]
Now 'text2html infile outfile' will create special html sequences for certain characters in a text file and save it in a new file.
alias html2text copy awnpipe:t2h/f/u/r[]
Now 'html2text infile outfile' will convert special HTML sequences in a html file and save it in a new file.
---
This next example is rather complex and is best studied after you have a working knowledge of AWNP.
It might be useful to be able to check an icons tooltype from an ADOS script, as earlier examples
have shown the '/Xt' option can do this. There is a problem however. You need to write data to the
pipe (the tooltype you wish to check), and read data from the pipe (the response to your query).
It is simple to write data to the pipe with echo.
'echo "filetype" >awnpipe:test/Xtpath:file'
A pipe connected to path:file.icon is opened and the data 'filetype' is written to it. When the echo
command completes it closes the pipe. This breaks the connection to the tooltype host and the host
exits. You do not get a chance to read the response from the host.
The '/m' option (multiple opens) solves this by allowing you to open the pipe connection to the
tooltype host more than once.
'echo "filetype" >awnpipe:test/m/Xtpath:file'
Again a pipe is connected to the tooltype host is created and sent data. This time however when echo
closes its pipe the connection to the host is not lost. AWNPipe knows you want to connect to the same
pipe again later.
'type awnpipe:test'
This reads the response back from the tooltype host. Note you only specified the pipe name, you do
NOT include '/Xtpath:file' again. When the type command completes the connection to the host is broken
and the host exits.
This idea can be taken a step further.
'echo "filetype" >awnpipe:test/m/Xtpath:file'
'type awnpipe:test/m'
'echo "filesize" >awnpipe:test/m'
'type awnpipe:test/m'
'echo "filedate" >awnpipe:test/m'
'type awnpipe:test'
The connection to the host is not broken until you finally open the pipe a last time without the '/m'